package com.thug.managers;


import com.thug.engine.EntityManager;
import com.thug.engine.SceneManager;
import com.thug.entities.Obstacle;

public class ObstacleManager extends EntityManager<Obstacle> {

	public ObstacleManager(SceneManager s) {
		super(s);
	}

	@Override
	public void onLoad() {
		for(int i = 0; i < mEntities.size(); i++) {
			Obstacle obstacle = mEntities.get(i);
			obstacle.init();
		}
	}


	@Override
	public void update(float elapsedTime) {
		for(int i = 0; i < mEntities.size(); i++) {
			Obstacle obstacle = mEntities.get(i);
			obstacle.update(elapsedTime);
		}
		
	}


	@Override
	public void onDestroy() {
		for(Obstacle obstacle : mEntities) {
			obstacle.dispose();
		}
		mEntities.clear();
	}

}
